package com.sofun.ai.tools.impl;

import com.sofun.ai.service.GaodeWeatherService;
import com.sofun.ai.tools.Tools;
import dev.langchain4j.agent.tool.P;
import dev.langchain4j.agent.tool.Tool;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Component;

import java.util.List;

/**
 * 天气工具
 * @author:wjl
 * @see:
 * @since:
 * @date:2025-03-04-22:03
 * @description:com.study.langchain4jspringboot.ai.tool
 * @version:1.0
 */
@Component
@RequiredArgsConstructor
public class WeatherTool implements Tools {

    /**
     * 高德天气API
     */
    private final GaodeWeatherService weatherService;

    @Tool("获取天气信息")
    public List<GaodeWeatherService.Forecasts> getWeather(@P("城市名称") String city) {
        return weatherService.getWeather(city);
    }

}
